//
//  TollIEventDetailViewController.m
//  Runone
//
//  Created by runone02 on 16/8/30.
//  Copyright © 2016年 runone. All rights reserved.
//

#import "TollIEventDetailViewController.h"
#import "RequestGinsengModel.h"
#import "RequestHelper.h"
#import "AppLocalManager.h"
#import "AppDelegate.h"
#import "MJRefresh.h"
#import "TollStationInfo.h"
#import "TollEventTopView.h"
@interface TollIEventDetailViewController ()
@property (nonatomic, strong)TollEventTopView *tollTopView;
@end

@implementation TollIEventDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"收费事件";
    [self configUI];
    [self loadData];
}

- (void)configUI {
    self.tollTopView =[TollEventTopView tollEventTopView];
    self.tollTopView.frame = CGRectMake(0,64, self.view.bounds.size.width,250);
    [self.view addSubview:self.tollTopView];

}

- (void)loadData {
    RequestHelper *requestHelper=[[RequestHelper alloc] init];
    RequestGinsengModel *GetTollStationEventDetailInfoModel=[[RequestGinsengModel alloc] init];
    GetTollStationEventDetailInfoModel.URL         = GetEventDataURL;
    GetTollStationEventDetailInfoModel.DataValue   = [self DataValueStr:self.model.EventUID];
    GetTollStationEventDetailInfoModel.UpdatedTime = @"";
    GetTollStationEventDetailInfoModel.SystemCode  = @"GuangleHighway";
    GetTollStationEventDetailInfoModel.MethodName  = @"GetTollStationEventDetailInfo";
    requestHelper.block=^(RequestOutginseng *requestOutginseng,id dataValueModel){
        TollStationInfo *model = dataValueModel;
        [self.tollTopView setTollModel:model andTollEventModel:self.model];
    };
    [requestHelper RequestGinsengModel:GetTollStationEventDetailInfoModel];
}



-(NSString *)DataValueStr:(NSString *)IncidentUID
{
    NSString *valueStr =[NSString stringWithFormat:@"[{\"key\":\"EventUID\",\"value\":\"%@\"}]",IncidentUID];
    return valueStr;
}

@end
